package com.ruoyi.business.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ruoyi.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.ruoyi.common.core.domain.BaseEntity;

/**
 * S7协议变量配置对象 s7_variables_config
 * 
 * @author qiancheng
 * @date 2025-08-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("s7_variables_config")
public class S7VariablesConfig extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 变量ID，主键 */
    @TableId(value = "variable_id", type = IdType.ASSIGN_ID)
//    @JsonSerialize(using = ToStringSerializer.class)
    private Long variableId;

    /** 变量名称 */
    @Excel(name = "变量名称")
    @TableField(value = "variable_name")
    private String variableName;

    /** 变量英文名称 */
    @Excel(name = "变量英文名称")
    @TableField(value = "variable_en_name")
    private String variableEnName;

    /** PLC IP地址 */
    @Excel(name = "PLC IP地址")
    @TableField(value = "plc_ip")
    private String plcIp;

    /** PLC端口号，默认102 */
    @Excel(name = "PLC端口号，默认102")
    @TableField(value = "plc_port")
    private Long plcPort;

    /** 机架号 */
    @Excel(name = "机架号")
    @TableField(value = "rack")
    private Long rack;

    /** 插槽号 */
    @Excel(name = "插槽号")
    @TableField(value = "slot")
    private Long slot;

    /** 数据类型：BOOL,BYTE,WORD,DWORD,INT,DINT,REAL,STRING等 */
    @Excel(name = "数据类型：BOOL,BYTE,WORD,DWORD,INT,DINT,REAL,STRING等")
    @TableField(value = "data_type")
    private String dataType;

    /** DB块号（如DB67中的67） */
    @Excel(name = "DB块号", readConverterExp = "如=DB67中的67")
    @TableField(value = "db_number")
    private Long dbNumber;

    /** 起始地址（如DD0,DD4等） */
    @Excel(name = "起始地址", readConverterExp = "如=DD0,DD4等")
    @TableField(value = "start_address")
    private String startAddress;

    /** 是否激活：0=禁用，1=启用 */
    @Excel(name = "是否激活：0=禁用，1=启用")
    @TableField(value = "is_active")
    private String isActive;



}
